/* api */
import BaseSelectUserApi from '@src/component/common/BaseSelectUser/api'
import { getTriggerMarkList } from '@src/api/Message'
/* vue */
import Vue from 'vue'
import Vuex from 'vuex'
/* model */
import { 
  BaseSelectUserVuexPropertyEnum, 
  BaseSelectUserUserListKeyEnum,
  BaseSelectUserLoadingKeyEnum,
  BaseSelectUserFilterNeedUpdateKeyEnum
} from '@src/component/common/BaseSelectUser/store/model'
import {
  SelectUserComponentDepartment, 
  SelectUserComponentUser, 
  SelectUserLabel, 
  SelectUserComponentRole, 
  SelectUserComponentProjectTeam,
  SelectUserState, 
  SelectUserComponentServiceProvider, 
  BaseSelectUserSearchMoreTypeEnum,
  BaseSelectUserPropsOptions,
  BaseBindTabInfoOptions,
} from '@src/component/common/BaseSelectUser/model'
/* types */
import type { 
  BaseSelectUserStoreDepartmentDataType, 
  BaseSelectUserStoreSelectUserListDataType, 
  BaseSelectUserStoreStateType, 
  BaseSelectUserStoreUserCountMapDataType, 
  BaseSelectUserStoreUserCountMapType, 
  BaseSelectUserStoreUserListMapDataType, 
  BaseSelectUserStoreUserListMapType,
  BaseSelectUserStoreLoadingMapType,
  BaseSelectUserStoreLoadingMapDataType,
  BaseSelectUserStoreFilterNeedUpdateMapDateType,
  BaseSelectUserStoreFilterNeedUpdateMapType
} from '@src/component/common/BaseSelectUser/store/type'
import { 
  BaseSelectUserFilterDepartmentForm,
  BaseSelectUserFilterRoleForm,
  BaseSelectUserFilterServiceProviderForm,
  BaseSelectUserGetDepartmentListModel,
  BaseSelectUserGetDepartmentUserListModel,
  BaseSelectUserGetMarkListModel,
  BaseSelectUserGetRoleListModel, 
  BaseSelectUserGetRoleUserListModel, 
  BaseSelectUserGetSearchMoreUserListModel, 
  BaseSelectUserGetSearchUserListModel, 
  BaseSelectUserGetServiceProviderListModel, 
  BaseSelectUserGetServiceProviderUserListModel,
  BaseSelectUserGetProjectTeamListModel,
  BaseSelectUserMark, 
  BaseSelectUserSelectedItemType, 
  SelectUserServiceProviderQualificationType,
  SelectUserServiceProviderTypeType,
  BaseSelectUserGetProjectTeamUserListModel
} from '@src/component/common/BaseSelectUser/types'
/* util */
import { cloneDeep } from 'lodash'

Vue.use(Vuex)

const defaultUserListMap = {
  [BaseSelectUserUserListKeyEnum.Department]: [],
  [BaseSelectUserUserListKeyEnum.DepartmentRoot]: [],
  [BaseSelectUserUserListKeyEnum.Role]: [],
  [BaseSelectUserUserListKeyEnum.ServiceProvider]: [],
  [BaseSelectUserUserListKeyEnum.SearchMore]: [],
  [BaseSelectUserUserListKeyEnum.ProjectTeam]: []
}

const defaultUserCountMap = {
  [BaseSelectUserUserListKeyEnum.Department]: 0,
  [BaseSelectUserUserListKeyEnum.DepartmentRoot]: 0,
  [BaseSelectUserUserListKeyEnum.Role]: 0,
  [BaseSelectUserUserListKeyEnum.ServiceProvider]: 0,
  [BaseSelectUserUserListKeyEnum.SearchMore]: 0,
  [BaseSelectUserUserListKeyEnum.ProjectTeam]: 0
}

const defaultLoadingMap = {
  [BaseSelectUserLoadingKeyEnum.Department]: true,
  [BaseSelectUserLoadingKeyEnum.DepartmentUser]: true,
  [BaseSelectUserLoadingKeyEnum.Role]: true,
  [BaseSelectUserLoadingKeyEnum.RoleUser]: true,
  [BaseSelectUserLoadingKeyEnum.ServiceProvider]: true,
  [BaseSelectUserLoadingKeyEnum.ServiceProviderUser]: true,
  [BaseSelectUserLoadingKeyEnum.ProjectTeam]: true,
  [BaseSelectUserLoadingKeyEnum.ProjectTeamUser]: true,
  [BaseSelectUserLoadingKeyEnum.Search]: true,
  [BaseSelectUserLoadingKeyEnum.Tab]: true
}

const defaultFilterNeedUpdateMap = {
  [BaseSelectUserFilterNeedUpdateKeyEnum.Department]: false,
  [BaseSelectUserFilterNeedUpdateKeyEnum.Role]: false,
  [BaseSelectUserFilterNeedUpdateKeyEnum.ServiceProvider]: false,
}

let baseSelectUserStoreState: BaseSelectUserStoreStateType = {
  // 选人控件的查询标签列表
  markList: [],
  // 当前选人控件选中的标签页类型
  currentTabType: '',
  // 部门数据
  departmentData: {
    // 根部门列表
    departmentRootList: [],
    // 部门列表
    departmentList: [],
    // 人员列表
    userList: []
  },
  // 用户工作状态列表
  userStateList: [],
  // 人员标签列表
  userLabelList: [],
  // 用户列表对象
  userListMap: defaultUserListMap,
  // 用户数量对象
  userCountMap: defaultUserCountMap,
  // 加载状态对象
  loadingMap: defaultLoadingMap,
  filterNeedUpdateMap: defaultFilterNeedUpdateMap,
  // 角色列表
  roleList: [],
  // 服务商列表
  serviceProviderList: [],
  // 项目列表
  projectTeamList: [],
  // 服务商资质列表
  serviceProviderQualificationList: [],
  // 当前列表展开查看的角色
  currentToggleRole: null,
  // 当前列表展开查看的项目
  currentToggleProjectTeam: null,
  // 当前列表展开查看的服务商
  currentToggleServiceProvider: null,
  // 搜索人员数据
  searchUserListData: {
    // 组织架构人员列表
    organizationUserList: [],
    // 服务商人员列表
    serviceProviderUserList: []
  },
  // 筛选 - 部门表单
  filterDepartmentForm: {
    // 工作状态列表
    stateList: [],
    // 人员标签 id 列表
    labelIdList: [],
    // 部门名称
    tagName: '',
    // 资质证书
    qualificationManagement:[]
  },
  // 筛选 - 角色表单
  filterRoleForm: {
    // 工作状态列表
    stateList: [],
    // 人员标签 id 列表
    labelIdList: [],
    // 角色名称
    roleName: '',
    // 资质证书
    qualificationManagement:[]
  },
  // 筛选 - 服务商表单
  filterServiceProviderForm: {
    // 工作状态列表
    stateList: [],
    // 服务商资质列表
    spList: [],
    // 服务商类型列表
    spTypeList: [],
    // 服务商名称
    spName: '',
    // 资质证书
    qualificationManagement:[]
  },
  // 服务商类型列表
  serviceProviderTypeList: [],
  // 部门面包屑导航列表
  departmentNavList: [],
  // 当前部门导航
  currentDepartmentNav: null,
  // 已选中列表
  checkedItemList: [],
  // 查询部门人员列表参数
  departmentUserListParams: {
    // 部门 id
    id: '',
    // 部门类型 id
    typeId: null,
    // 人员标签 id 列表
    labelIdList: [],
    // 工作状态列表
    stateList: [],
    // 当前页码
    pageNum: 1,
    // 每页数量
    pageSize: 30,
    // 是否显示用户
    showUser: true,
    // 是否显示未分配人员
    showNoDistribute: false
  },
  // 查询部门列表参数
  departmentListParams: {
    // 部门名称
    tagName: '',
    // 工作状态列表
    stateList: [],
    // 人员标签 id 列表
    labelIdList: [],
    // 当前页码
    pageNum: 1,
    // 每页数量
    pageSize: 30,
    // 是否显示已删除
    showDelete: true,
    // 是否显示用户
    showUser: true,
  },
  // 查询角色人员列表参数
  roleUserListParams: {
    // 角色 id
    id: '',
    // 人员标签 id 列表
    labelIdList: [],
    // 工作状态列表
    stateList: [],
    // 当前页码
    pageNum: 1,
    // 每页数量
    pageSize: 30
  },
  // 查询角色列表参数
  roleListParams: {
    // 人员标签 id 列表
    labelIdList: [],
    // 角色名称
    roleName: '',
    // 工作状态列表
    stateList: [],
    // 是否显示待分配
    showNoDistribute: true
  },
  // 查询服务商人员列表参数
  serviceProviderUserListParams: {
    // 服务商 id
    id: '',
    // 工作状态列表
    stateList: [],
    // 当前页码
    pageNum: 1,
    // 每页数量
    pageSize: 30
  },
  // 查询服务商列表参数
  serviceProviderListParams: {
    // 工作状态列表
    stateList: [],
    // 服务商资质列表
    spList: [],
    // 服务商类型列表
    spTypeList: [],
    // 是否显示已注销
    showCancel: true,
    // 服务商名称
    spName: '',
    // 是否显示服务商全部
    showSpAll: false
  },
  // 查询 搜索更多用户列表参数
  searchMoreUserListParams: {
    keyword: '',
    clickType: BaseSelectUserSearchMoreTypeEnum.Organization,
    // 当前页码
    pageNum: 1,
    // 每页数量
    pageSize: 30,
    showDelete: true,
    showTagIfSpUser: false,
    showNoDistribute: false
  },
  keyword: '',
  // 当前搜索更多类型
  currentSearchMoreType: null,
  isSearchOrganizationHasMore: false,
  isSearchSpHasMore: false,
  // 服务商面包屑导航列表
  serviceProviderNavList: [],
  // 当前服务商导航
  currentServiceProviderNav: null,
  isFilterVisible: false,
  options: undefined,
  // 当前组件与tab绑定的列表
  bindTabInfo: {},
  CustomOptions: {}
}

const DefaultBaseSelectUserStoreState = cloneDeep(baseSelectUserStoreState)

const store = new Vuex.Store({
  state: baseSelectUserStoreState,
  mutations: {
    [BaseSelectUserVuexPropertyEnum.SetMarkList](state: BaseSelectUserStoreStateType, value: BaseSelectUserMark[]) {
      state.markList = value
    },
    
    [BaseSelectUserVuexPropertyEnum.SetCurrentTabType](state: BaseSelectUserStoreStateType, value: string) {
      state.currentTabType = value
    },
    
    [BaseSelectUserVuexPropertyEnum.SetDepartmentData](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreDepartmentDataType) {
      state.departmentData = value
    },
    [BaseSelectUserVuexPropertyEnum.SetDepartmentDataDepartmentRootList](state: BaseSelectUserStoreStateType, value: SelectUserComponentDepartment[]) {
      state.departmentData.departmentRootList = value
    },
    [BaseSelectUserVuexPropertyEnum.SetDepartmentDataDepartmentList](state: BaseSelectUserStoreStateType, value: SelectUserComponentDepartment[]) {
      state.departmentData.departmentList = value
    },
    [BaseSelectUserVuexPropertyEnum.SetDepartmentDataUserList](state: BaseSelectUserStoreStateType, value: SelectUserComponentUser[]) {
      state.departmentData.userList = value
    },
    
    [BaseSelectUserVuexPropertyEnum.SetUserStateList](state: BaseSelectUserStoreStateType, value: SelectUserState[]) {
      state.userStateList = value
    },
    [BaseSelectUserVuexPropertyEnum.SetUserLabelList](state: BaseSelectUserStoreStateType, value: SelectUserLabel[]) {
      state.userLabelList = value
    },
    
    [BaseSelectUserVuexPropertyEnum.SetUserListMap](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreUserListMapType) {
      state.userListMap = value
    },
    [BaseSelectUserVuexPropertyEnum.SetUserListMapDepartmentRootUserList](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreUserListMapDataType) {
      state.userListMap[BaseSelectUserUserListKeyEnum.DepartmentRoot] = value
    },
    [BaseSelectUserVuexPropertyEnum.SetUserListMapDepartmentUserList](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreUserListMapDataType) {
      state.userListMap[BaseSelectUserUserListKeyEnum.Department] = value
    },
    [BaseSelectUserVuexPropertyEnum.SetUserListMapRoleUserList](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreUserListMapDataType) {
      state.userListMap[BaseSelectUserUserListKeyEnum.Role] = value
    },
    [BaseSelectUserVuexPropertyEnum.SetUserListMapServiceProviderUserList](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreUserListMapDataType) {
      state.userListMap[BaseSelectUserUserListKeyEnum.ServiceProvider] = value
    },
    [BaseSelectUserVuexPropertyEnum.SetUserListMapProjectTeamUserList](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreUserListMapDataType) {
      state.userListMap[BaseSelectUserUserListKeyEnum.ProjectTeam] = value
    },
    [BaseSelectUserVuexPropertyEnum.SetUserListMapSearchMoreUserList](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreUserListMapDataType) {
      state.userListMap[BaseSelectUserUserListKeyEnum.SearchMore] = value
    },
    
    [BaseSelectUserVuexPropertyEnum.SetUserCountMap](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreUserCountMapType) {
      state.userCountMap = value
    },
    [BaseSelectUserVuexPropertyEnum.SetUserCountMapDepartmentUserCount](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreUserCountMapDataType) {
      state.userCountMap[BaseSelectUserUserListKeyEnum.Department] = value
    },
    [BaseSelectUserVuexPropertyEnum.SetUserCountMapDepartmentRootUserCount](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreUserCountMapDataType) {
      state.userCountMap[BaseSelectUserUserListKeyEnum.DepartmentRoot] = value
    },
    [BaseSelectUserVuexPropertyEnum.SetUserCountMapRoleUserCount](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreUserCountMapDataType) {
      state.userCountMap[BaseSelectUserUserListKeyEnum.Role] = value
    },
    [BaseSelectUserVuexPropertyEnum.SetUserCountMapServiceProviderUserCount](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreUserCountMapDataType) {
      state.userCountMap[BaseSelectUserUserListKeyEnum.ServiceProvider] = value
    },
    [BaseSelectUserVuexPropertyEnum.SetUserCountMapSearchMoreUserCount](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreUserCountMapDataType) {
      state.userCountMap[BaseSelectUserUserListKeyEnum.SearchMore] = value
    },
    
    [BaseSelectUserVuexPropertyEnum.SetRoleList](state: BaseSelectUserStoreStateType, value: SelectUserComponentRole[]) {
      state.roleList = value
    },
    [BaseSelectUserVuexPropertyEnum.SetCurrentToggleRole](state: BaseSelectUserStoreStateType, value: SelectUserComponentRole | null) {
      state.currentToggleRole = value
    },
    
    [BaseSelectUserVuexPropertyEnum.SetServiceProviderList](state: BaseSelectUserStoreStateType, value: SelectUserComponentServiceProvider[]) {
      state.serviceProviderList = value
    },
    [BaseSelectUserVuexPropertyEnum.SetProjectTeamList](state: BaseSelectUserStoreStateType, value: SelectUserComponentProjectTeam[]) {
      state.projectTeamList = value;
    },
    [BaseSelectUserVuexPropertyEnum.SetProjectCurrentToggleProjectTeam](state: BaseSelectUserStoreStateType, value: SelectUserComponentProjectTeam | null) {
      state.currentToggleProjectTeam = value;
    },
    [BaseSelectUserVuexPropertyEnum.SetServiceProviderQualificationList](state: BaseSelectUserStoreStateType, value: SelectUserServiceProviderQualificationType[]) {
      state.serviceProviderQualificationList = value
    },
    [BaseSelectUserVuexPropertyEnum.SetServiceProviderTypeList](state: BaseSelectUserStoreStateType, value: SelectUserServiceProviderTypeType[]) {
      state.serviceProviderTypeList = value
    },
    [BaseSelectUserVuexPropertyEnum.SetCurrentToggleServiceProvider](state: BaseSelectUserStoreStateType, value: SelectUserComponentServiceProvider | null) {
      state.currentToggleServiceProvider = value
    },
    
    [BaseSelectUserVuexPropertyEnum.SetSearchUserListData](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreSelectUserListDataType) {
      state.searchUserListData = value
    },
    
    [BaseSelectUserVuexPropertyEnum.SetLoadingMap](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreLoadingMapType) {
      state.loadingMap = value
    },
    [BaseSelectUserVuexPropertyEnum.SetLoadingMapDepartmentLoading](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreLoadingMapDataType) {
      state.loadingMap[BaseSelectUserLoadingKeyEnum.Department] = value
    },
    [BaseSelectUserVuexPropertyEnum.SetLoadingMapDepartmentUserLoading](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreLoadingMapDataType) {
      state.loadingMap[BaseSelectUserLoadingKeyEnum.DepartmentUser] = value
    },
    [BaseSelectUserVuexPropertyEnum.SetLoadingMapRoleLoading](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreLoadingMapDataType) {
      state.loadingMap[BaseSelectUserLoadingKeyEnum.Role] = value
    },
    [BaseSelectUserVuexPropertyEnum.SetLoadingMapRoleUserLoading](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreLoadingMapDataType) {
      state.loadingMap[BaseSelectUserLoadingKeyEnum.RoleUser] = value
    },
    [BaseSelectUserVuexPropertyEnum.SetLoadingMapServiceProviderLoading](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreLoadingMapDataType) {
      state.loadingMap[BaseSelectUserLoadingKeyEnum.ServiceProvider] = value
    },
    [BaseSelectUserVuexPropertyEnum.SetLoadingMapServiceProviderUserLoading](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreLoadingMapDataType) {
      state.loadingMap[BaseSelectUserLoadingKeyEnum.ServiceProviderUser] = value
    },
    [BaseSelectUserVuexPropertyEnum.SetLoadingMapProjectTeamLoading](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreLoadingMapDataType) {
      state.loadingMap[BaseSelectUserLoadingKeyEnum.ProjectTeam] = value
    },
    [BaseSelectUserVuexPropertyEnum.SetLoadingMapProjectTeamUserLoading](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreLoadingMapDataType) {
      state.loadingMap[BaseSelectUserLoadingKeyEnum.ProjectTeamUser] = value
    },
    [BaseSelectUserVuexPropertyEnum.SetLoadingMapSearchLoading](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreLoadingMapDataType) {
      state.loadingMap[BaseSelectUserLoadingKeyEnum.Search] = value
    },
    [BaseSelectUserVuexPropertyEnum.SetLoadingMapTabLoading](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreLoadingMapDataType) {
      state.loadingMap[BaseSelectUserLoadingKeyEnum.Tab] = value
    },
    
    [BaseSelectUserVuexPropertyEnum.SetFilterNeedUpdateMap](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreFilterNeedUpdateMapType) {
      state.filterNeedUpdateMap = value
    },
    [BaseSelectUserVuexPropertyEnum.SetFilterNeedUpdateMapDepartment](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreFilterNeedUpdateMapDateType) {
      state.filterNeedUpdateMap[BaseSelectUserFilterNeedUpdateKeyEnum.Department] = value
    },
    [BaseSelectUserVuexPropertyEnum.SetFilterNeedUpdateMapRole](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreFilterNeedUpdateMapDateType) {
      state.filterNeedUpdateMap[BaseSelectUserFilterNeedUpdateKeyEnum.Role] = value
    },
    [BaseSelectUserVuexPropertyEnum.SetFilterNeedUpdateMapServiceProvider](state: BaseSelectUserStoreStateType, value: BaseSelectUserStoreFilterNeedUpdateMapDateType) {
      state.filterNeedUpdateMap[BaseSelectUserFilterNeedUpdateKeyEnum.ServiceProvider] = value
    },
    
    [BaseSelectUserVuexPropertyEnum.SetFilterDepartmentForm](state: BaseSelectUserStoreStateType, value: BaseSelectUserFilterDepartmentForm) {
      state.filterDepartmentForm = value
    },
    [BaseSelectUserVuexPropertyEnum.SetFilterRoleForm](state: BaseSelectUserStoreStateType, value: BaseSelectUserFilterRoleForm) {
      state.filterRoleForm = value
    },
    [BaseSelectUserVuexPropertyEnum.SetFilterServiceProviderForm](state: BaseSelectUserStoreStateType, value: BaseSelectUserFilterServiceProviderForm) {
      state.filterServiceProviderForm = value
    },
    
    [BaseSelectUserVuexPropertyEnum.SetDepartmentNavList](state: BaseSelectUserStoreStateType, value: SelectUserComponentDepartment[]) {
      state.departmentNavList = value
    },
    [BaseSelectUserVuexPropertyEnum.SetCurrentDepartmentNav](state: BaseSelectUserStoreStateType, value: SelectUserComponentDepartment) {
      state.currentDepartmentNav = value
    },
    [BaseSelectUserVuexPropertyEnum.SetCheckedItemList](state: BaseSelectUserStoreStateType, value: BaseSelectUserSelectedItemType[]) {
      state.checkedItemList = value
    },
    
    [BaseSelectUserVuexPropertyEnum.SetDepartmentListParams](state: BaseSelectUserStoreStateType, value: BaseSelectUserGetDepartmentListModel) {
      state.departmentListParams = value
    },
    [BaseSelectUserVuexPropertyEnum.SetDepartmentUserListParams](state: BaseSelectUserStoreStateType, value: BaseSelectUserGetDepartmentUserListModel) {
      state.departmentUserListParams = value
    },
    [BaseSelectUserVuexPropertyEnum.SetRoleListParams](state: BaseSelectUserStoreStateType, value: BaseSelectUserGetRoleListModel) {
      state.roleListParams = value
    },
    [BaseSelectUserVuexPropertyEnum.SetRoleUserListParams](state: BaseSelectUserStoreStateType, value: BaseSelectUserGetRoleUserListModel) {
      state.roleUserListParams = value
    },
    [BaseSelectUserVuexPropertyEnum.SetServiceProviderListParams](state: BaseSelectUserStoreStateType, value: BaseSelectUserGetServiceProviderListModel) {
      state.serviceProviderListParams = value
    },
    [BaseSelectUserVuexPropertyEnum.SetServiceProviderUserListParams](state: BaseSelectUserStoreStateType, value: BaseSelectUserGetServiceProviderUserListModel) {
      state.serviceProviderUserListParams = value
    },
    [BaseSelectUserVuexPropertyEnum.SetSearchMoreUserListParams](state: BaseSelectUserStoreStateType, value: BaseSelectUserGetSearchMoreUserListModel) {
      state.searchMoreUserListParams = value
    },
    
    [BaseSelectUserVuexPropertyEnum.SetKeyword](state: BaseSelectUserStoreStateType, value: string) {
      state.keyword = value
    },
    [BaseSelectUserVuexPropertyEnum.SetCurrentSearchMoreType](state: BaseSelectUserStoreStateType, value: BaseSelectUserSearchMoreTypeEnum | null) {
      state.currentSearchMoreType = value
    },
    [BaseSelectUserVuexPropertyEnum.SetIsSearchOrganizationHasMore](state: BaseSelectUserStoreStateType, value: boolean) {
      state.isSearchOrganizationHasMore = value
    },
    [BaseSelectUserVuexPropertyEnum.SetIsSearchSpHasMore](state: BaseSelectUserStoreStateType, value: boolean) {
      state.isSearchSpHasMore = value
    },
    
    [BaseSelectUserVuexPropertyEnum.SetServiceProviderNavList](state: BaseSelectUserStoreStateType, value: SelectUserComponentServiceProvider[]) {
      state.serviceProviderNavList = value
    },
    [BaseSelectUserVuexPropertyEnum.SetCurrentServiceProviderNav](state: BaseSelectUserStoreStateType, value: SelectUserComponentServiceProvider) {
      state.currentServiceProviderNav = value
    },
    
    [BaseSelectUserVuexPropertyEnum.SetIsFilterVisible](state: BaseSelectUserStoreStateType, value: boolean) {
      state.isFilterVisible = value
    },
    
    [BaseSelectUserVuexPropertyEnum.SetOptions](state: BaseSelectUserStoreStateType, value?: BaseSelectUserPropsOptions) {
      state.options = value
    },

    [BaseSelectUserVuexPropertyEnum.SetBindTabInfo](state: BaseSelectUserStoreStateType, value: BaseBindTabInfoOptions) {
      state.bindTabInfo = value
    },
    [BaseSelectUserVuexPropertyEnum.SetSearchCustomOptions](state: BaseSelectUserStoreStateType, value?: BaseSelectUserPropsOptions) {
      state.CustomOptions = value
    },
  },
  actions: {
    [BaseSelectUserVuexPropertyEnum.FetchMarkList]({ commit, state }, params: BaseSelectUserGetMarkListModel) {
      return BaseSelectUserApi.getSelectUserMarkList(params)
    },
    [BaseSelectUserVuexPropertyEnum.FetchTriggerMarkList]({ commit, state }, params: BaseSelectUserGetMarkListModel) {
      return getTriggerMarkList(params)
    },
    [BaseSelectUserVuexPropertyEnum.FetchDepartmentList]({ commit, state }, params: BaseSelectUserGetDepartmentListModel) {
      return BaseSelectUserApi.getSelectUserDepartmentList(params)
    },
    [BaseSelectUserVuexPropertyEnum.FetchUserStateList]({ commit, state }) {
      return BaseSelectUserApi.getSelectUserStateList()
    },
    [BaseSelectUserVuexPropertyEnum.FetchUserLabelList]({ commit, state }) {
      return BaseSelectUserApi.getSelectUserLabelList()
    },
    [BaseSelectUserVuexPropertyEnum.FetchRoleList]({ commit, state }, params: BaseSelectUserGetRoleListModel) {
      return BaseSelectUserApi.getSelectRoleList(params)
    },
    [BaseSelectUserVuexPropertyEnum.FetchServiceProviderList]({ commit, state }, params: BaseSelectUserGetServiceProviderListModel) {
      return BaseSelectUserApi.getSelectServiceProviderList(params)
    },
    [BaseSelectUserVuexPropertyEnum.FetchServiceProviderQualificationList]({ commit, state }) {
      return BaseSelectUserApi.getSelectServiceProviderQualificationList()
    },
    [BaseSelectUserVuexPropertyEnum.FetchRoleUserList]({ commit, state }, params: BaseSelectUserGetRoleUserListModel) {
      return BaseSelectUserApi.getSelectRoleUserList(params)
    },
    [BaseSelectUserVuexPropertyEnum.FetchServiceProviderUserList]({ commit, state }, params: BaseSelectUserGetServiceProviderUserListModel) {
      return BaseSelectUserApi.getSelectServiceProviderUserList(params)
    },
    [BaseSelectUserVuexPropertyEnum.FetchSearchUserList]({ commit, state }, params: BaseSelectUserGetSearchUserListModel) {
      return BaseSelectUserApi.getSelectSearchUserList(params)
    },
    [BaseSelectUserVuexPropertyEnum.FetchServiceProviderTypeList]({ commit, state }) {
      return BaseSelectUserApi.getSelectServiceProviderTypeList()
    },
    [BaseSelectUserVuexPropertyEnum.FetchDepartmentUserList]({ commit, state }, params: BaseSelectUserGetDepartmentUserListModel) {
      return BaseSelectUserApi.getSelectDepartmentUserList(params)
    },
    [BaseSelectUserVuexPropertyEnum.FetchSearchMoreUserList]({ commit, state }, params: BaseSelectUserGetSearchMoreUserListModel) {
      return BaseSelectUserApi.getSelectSearchMoreUserList(params)
    },
  }
})

export * from '@src/component/common/BaseSelectUser/store/model'
export * from '@src/component/common/BaseSelectUser/store/type'
export * from '@src/component/common/BaseSelectUser/store/hooks'

export {
  DefaultBaseSelectUserStoreState
}

export default store
